package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.SeedConsumeTemporaryMapper;
import com.ruoyi.consume.domain.SeedConsumeTemporary;
import com.ruoyi.consume.service.ISeedConsumeTemporaryService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class SeedConsumeTemporaryServiceImpl implements ISeedConsumeTemporaryService
{
    @Autowired
    private SeedConsumeTemporaryMapper seedConsumeTemporaryMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param seedConsumeTemporaryId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public SeedConsumeTemporary selectSeedConsumeTemporaryById(Long seedConsumeTemporaryId)
    {
        return seedConsumeTemporaryMapper.selectSeedConsumeTemporaryById(seedConsumeTemporaryId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param seedConsumeTemporary 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<SeedConsumeTemporary> selectSeedConsumeTemporaryList(SeedConsumeTemporary seedConsumeTemporary)
    {
        return seedConsumeTemporaryMapper.selectSeedConsumeTemporaryList(seedConsumeTemporary);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param seedConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertSeedConsumeTemporary(SeedConsumeTemporary seedConsumeTemporary)
    {
        seedConsumeTemporary.setCreateTime(DateUtils.getNowDate());
        return seedConsumeTemporaryMapper.insertSeedConsumeTemporary(seedConsumeTemporary);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param seedConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updateSeedConsumeTemporary(SeedConsumeTemporary seedConsumeTemporary)
    {
        seedConsumeTemporary.setUpdateTime(DateUtils.getNowDate());
        return seedConsumeTemporaryMapper.updateSeedConsumeTemporary(seedConsumeTemporary);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param seedConsumeTemporaryIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedConsumeTemporaryByIds(Long[] seedConsumeTemporaryIds)
    {
        return seedConsumeTemporaryMapper.deleteSeedConsumeTemporaryByIds(seedConsumeTemporaryIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param seedConsumeTemporaryId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedConsumeTemporaryById(Long seedConsumeTemporaryId)
    {
        return seedConsumeTemporaryMapper.deleteSeedConsumeTemporaryById(seedConsumeTemporaryId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<SeedConsumeTemporary> getUserName(){
        return seedConsumeTemporaryMapper.getUserName();
    }
}
